package com.comum.javahomework420242025.mapper;

import com.comum.javahomework420242025.pojo.ClientComeForResult;
import com.comum.javahomework420242025.pojo.DepartmentProductionForResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

@Mapper
public interface DepartmentProductionMapper {
    @Select("select * from departmentproduction join production on " +
            "departmentproduction.productionid=production.id where " +
            "production.type=#{type} and departmentproduction.department=#{department} and " +
            "(name like concat('%',concat(#{str},'%')) or model like concat('%',concat(#{str},'%')) or " +
            "number like concat('%',concat(#{str},'%')) or price like concat('%',concat(#{str},'%')) or " +
            "figurenumber like concat('%',concat(#{str},'%')) or material like concat('%',concat(#{str},'%')) or " +
            "departmentproduction.department like concat('%',concat(#{str},'%')) or " +
            "isdull like concat('%',concat(#{str},'%')))")
    List<DepartmentProductionForResult> selectByStr(String str, String type, String department);
    @Select("select * from departmentproduction join production on " +
            "departmentproduction.productionid=production.id where " +
            "departmentproduction.department=#{department} and " +
            "(name like concat('%',concat(#{str},'%')) or model like concat('%',concat(#{str},'%')) or " +
            "number like concat('%',concat(#{str},'%')) or price like concat('%',concat(#{str},'%')) or " +
            "figurenumber like concat('%',concat(#{str},'%')) or material like concat('%',concat(#{str},'%')) or " +
            "departmentproduction.department like concat('%',concat(#{str},'%')) or " +
            "isdull like concat('%',concat(#{str},'%')))")
    List<DepartmentProductionForResult> selectByStrOther(String str, String department);
}
